// 路由要分成两类
// 一类是登入，404这种
// 第二类是验证的

import Login from "../pages/Login";
import Index from "../pages/dashboard/Index";
import List from "../pages/admin/List";
import Edit from "../pages/admin/Edit";
import  Notices  from "../pages/notices/Index";
import PageNotFound from "../pages/PageNotFound";
import { DashboardOutlined, ShoppingOutlined } from '@ant-design/icons';

export const mainRoutes=[
    {
        path: "/login",
        component: Login
    },
    {
        path: '/404',
        component: PageNotFound
    }
];

export const adminRoutes=[
    {
        path: "dashboard",  // 改为相对路径，不要以 / 开头
        component: Index,
        isShow: true,
        title: "看板",
        icon: DashboardOutlined
    },
    {
        path: "products",   // 改为相对路径，不要以 / 开头
        component: List,
        exact: true,
        isShow: true,
        title: "商品管理",
        icon: ShoppingOutlined
    },
    {
        path: "products/edit/:id?",  // 改为相对路径，不要以 / 开头
        component: Edit
    },
    {
        path: 'notices',
        isShow: false,
        component: Notices

    }
];
